<?php

	$connection = mysql_connect('localhost', 'root' , '');
    $selection = mysql_select_db('test', $connection);

	$markerName = $_POST['markerName'];
   	$longitude = $_POST['longitude'];
   	$latitude = $_POST['latitude'];
   	$poiType = $_POST['poiType'];
   	$markerDesc = $_POST['markerDesc'];
   	$markerRule = $_POST['markerRule'];
   	
   	$uuName = $_POST['UUname'];
   	$uuAddress = $_POST['UUaddress'];
   	$uuNumber = $_POST['UUnumber'];
    
     //$db = mysql_connect('localhost','root','') or die('Error connecting to the server');
     //mysql_select_db('test') or die('Error selecting database');
     $result = mysql_query("INSERT INTO marker_poi(marker_name, marker_long, marker_lat, marker_type, marker_desc, marker_rule) VALUES('".$markerName."', '".$longitude."', '".$latitude."', '".$poiType."', '".$markerDesc."', '".$markerRule."')") or die ('Error performing query');
	 $result2 = mysql_query("INSERT INTO unregistereduser(marker_id, name, address, cnumber) VALUES((SELECT MAX(marker_id) FROM marker_poi),'".$uuName."', '".$uuAddress."', '".$uuNumber."')") or die ('Error performing query');
?>